package io.kiki.sba.registry.server.metadata;


import io.kiki.sba.registry.server.metadata.bootstrap.Enable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;


@Enable
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableScheduling
public class MetadataApplication {

    private static final Logger logger = LoggerFactory.getLogger(MetadataApplication.class);

    public static void main(String[] args) {
        // setup DefaultUncaughtExceptionHandler
        Thread.setDefaultUncaughtExceptionHandler((t, e) -> logger.error("UncaughtException in Thread({}): {}", t.getName(), e.getMessage(), e));

        SpringApplication.run(MetadataApplication.class, args);
    }
}
